package jtk.project4.fleet.field;

import jtk.project4.fleet.domain.Employee;
import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.TextField;

public class EmployeeContactAddressField extends GroupControl<Employee>{
	private TextField numberPostal;
	private TextField notesAddress1;
	private TextField notesAddress2;	
	private TextField notesCity;
	private TextField notesState;
	
	
	public EmployeeContactAddressField(String bindID){
		setTitle("Address");
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields(){
		numberPostal = new TextField ("number", 10);
		//numberPostal.setRequired(true);
		
		notesAddress1 = new TextField ("addr1",30);
		//notesAddress1.setRequired(true);
		
		notesAddress2 = new TextField ("addr2", 30);
		//notesAddress2.setRequired(true);
				
		notesCity = new TextField ("city", 15);
		//notesCity.setRequired(true);
		
		notesState = new TextField ("state",10);
		//notesState.setRequired(true);
		
		
	}
	
	private void createLayout() {
		setLayout(new FormLayout())
		.addLabel("label.address1").addField(notesAddress1)
		.addRow()
		.addLabel("label.address2").addField(notesAddress2)
		.addRow()
		.addLabel("label.city").addField(notesCity)
		.addLabel("label.state").addField(notesState)
		.addRow()
		.addLabel("label.postal").addField(numberPostal);
	}
	
}
